 //
//  DetailScrollView.m
//  bh
//
//  Created by lanou on 15/12/19.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "DetailScrollView.h"

#import "ProfessorModel.h"

@implementation DetailScrollView

- (instancetype)initWithFrame:(CGRect)frame {
    
    if ( self = [super initWithFrame:frame]) {

       _pictureView = [[UIImageView alloc] initWithFrame:CGRectMake(kWidth / 2 - 50, 50, kWidth / 3, kWidth / 3)];
        _pictureView.layer.masksToBounds = YES;
        _pictureView.layer.borderWidth = 2;
        _pictureView.layer.cornerRadius = _pictureView.bounds.size.height / 2;
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 - 10, kWidth / 3 + 60, 80, 20)];
        _nameLabel.font = [UIFont systemFontOfSize:22];
        
        _professorLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 + 60, kWidth / 3 + 60, 70, 20)];
        _professorLabel.textColor = [UIColor whiteColor];
        _professorLabel.backgroundColor = [UIColor blueColor];
        
        _contactLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 - 50, kWidth / 3 + 90, 50, 20)];
        _contactLabel.textColor = [UIColor orangeColor];
        _contactLabel.font = [UIFont systemFontOfSize:24];
        
        _contactLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 - 60, kWidth / 3 + 110, 80, 20)];
        
        _contactLabel1.font = [UIFont systemFontOfSize:15];
        _contactLabel1.textColor = [UIColor grayColor];
        
        _reviewLabel = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 + 50, kWidth / 3 + 90, 50, 20)];
        _reviewLabel.textColor = [UIColor orangeColor];
        _reviewLabel.font = [UIFont systemFontOfSize:24];

        _reviewLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 2 + 40, kWidth / 3 + 110, 80, 20)];
        _reviewLabel1.text = @"人预约过";
        _reviewLabel1.font = [UIFont systemFontOfSize:15];
        _reviewLabel1.textColor = [UIColor grayColor];
        
        _button1 = [[UIButton alloc] initWithFrame:CGRectMake(10, kWidth / 2 + 90, kWidth / 4 + 20, 40)];
        _button1.backgroundColor = [UIColor orangeColor];
        [_button1 setTintColor:[UIColor whiteColor]];
        
        _button2 = [[UIButton alloc] initWithFrame:CGRectMake(kWidth / 2 - 30, kWidth / 2 + 90, kWidth / 5 + 20, 40)];
        _button2.backgroundColor = [UIColor greenColor];
        [_button2 setTintColor:[UIColor whiteColor]];
        [_button2 setTitle:@"关注" forState:(UIControlStateNormal)];
        
        
        _button3 = [[UIButton alloc] initWithFrame:CGRectMake(kWidth / 4 * 3 - 10, kWidth / 2 + 90, kWidth / 5 + 20, 40)];
        _button3.backgroundColor = [UIColor blackColor];
        [_button3 setTintColor:[UIColor whiteColor]];
        [_button3 setTitle:@"私信" forState:(UIControlStateNormal)];
        
        _personalView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight / 2 + 20)];
        _personalView.backgroundColor = [UIColor whiteColor];

        [_personalView addSubview:_pictureView];
        [_personalView addSubview:_nameLabel];
        [_personalView addSubview:_professorLabel];
        [_personalView addSubview:_contactLabel];
        [_personalView addSubview:_reviewLabel];
        [_personalView addSubview:_contactLabel1];
        [_personalView addSubview:_reviewLabel1];
        [_personalView addSubview:_button1];
        [_personalView addSubview:_button2];
        [_personalView addSubview:_button3];
        
        
        _detailView = [[UIView alloc] initWithFrame:CGRectMake(0, kHeight / 2 + 30, kWidth, kHeight / 2 - 50)];
        _detailView.backgroundColor = [UIColor whiteColor];
        
        _serviceLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 20, 120, 20)];
        _serviceLabel.text = @"服务地区";
        _serviceLabel.textColor = [UIColor grayColor];
        
        _serviceLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 4 + 15, 20, kWidth / 4 * 3 - 15, 20)];
        _serviceLabel1.textColor = [UIColor grayColor];
        
        
        _designLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 120, 20)];
        _designLabel.textColor = [UIColor grayColor];
        
        _designLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 4 + 15, 70, kWidth / 4 * 3 - 15, 20)];
        _designLabel1.textColor = [UIColor orangeColor];
        
        
        _styleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 120, 120, 20)];
        _styleLabel.textColor = [UIColor grayColor];
        
        _styleLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 4 + 15, 120, kWidth / 4 * 3 - 15, 20)];
        _styleLabel1.textColor = [UIColor grayColor];
        
        _personLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 170, 220, 20)];
        _personLabel.textColor = [UIColor grayColor];
        
        _personLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(kWidth / 4 + 15, 160, kWidth / 4 * 3 - 15, 80)];
        _personLabel1.numberOfLines = 0;
        _personLabel1.textColor = [UIColor grayColor];
        
        
        
        [_detailView addSubview:_serviceLabel];
        [_detailView addSubview:_designLabel];
        [_detailView addSubview:_styleLabel];
        [_detailView addSubview:_personLabel];
        [_detailView addSubview:_serviceLabel1];
        [_detailView addSubview:_designLabel1];
        [_detailView addSubview:_styleLabel1];
        [_detailView addSubview:_personLabel1];
        
        
        _tableView = [[UITableView alloc] init];
    
        
        [self addSubview:_tableView];
        
        
        
        [self addSubview:_personalView];
        [self addSubview:_detailView];
        
        
        
    }
    
    return self;
    
}


- (void)setTableViewTarget:(id)target {
    // 遵守delegate 和 dataSource
    _tableView.delegate = target;
    _tableView.dataSource = target;
    
    _discussTableView.delegate = target;
    _discussTableView.dataSource = target;
    
}












@end
